home *** CD-ROM | disk | FTP | other *** search
/ No Fragments Archive 12: Textmags & Docs / nf_archive_12.iso / MAGS / SOURCES / ATARI_SRC.ZIP / atari source / FALCON / ACC / OUTLINE.ACC / OPTIONS.C < prev    next >
Encoding:
C/C++ Source or Header  |  2001-02-10  |  6.3 KB  |  279 lines

  1. /* ===================================================================
  2.  * FILE: OPTIONS.C
  3.  * ===================================================================
  4.  * DATE: December  9, 1992    Combine bitmap and outline fonts
  5.  *       December 15, 1992      Remove Bitmap fonts and devices
  6.  * 
  7.  * DESCRIPTION: Fonts ACC
  8.  *
  9.  * This file handles the options dialog box.
  10.  *
  11.  * COMPILER: TURBO C Version 2.0
  12.  */
  13.  
  14.  
  15. /* INCLUDE FILES
  16.  * ===================================================================
  17.  */
  18. #include <sys\gemskel.h>
  19. #include <tos.h>
  20. #include <linea.h>
  21. #include <string.h>
  22. #include <stdio.h>
  23.  
  24. #include "country.h"
  25. #include "fonthead.h"
  26. #include "fonts.h"
  27. #include "mainstuf.h"
  28. #include "text.h"
  29. #include "fsmio.h"
  30. #include "mover.h"
  31. #include "front.h"
  32.  
  33. #include "path.h"
  34. #include "points.h"
  35. #include "custom.h"
  36. #include "cache.h"
  37. #include "printer.h"
  38. #include "buildwd.h"
  39. #include "status.h"
  40.  
  41.  
  42.  
  43. /* STRUCTURES
  44.  * ===================================================================
  45.  */
  46.  
  47.  
  48. /* EXTERN
  49.  * ===================================================================
  50.  */
  51. extern int AES_Version;
  52.  
  53.  
  54.  
  55. /* PROTOTYPES
  56.  * ===================================================================
  57.  */
  58. void    DoOptions( void );
  59. int    HandleOptions( int button, WORD *msg );
  60. void    DoWidth( void );
  61.  
  62.  
  63.  
  64.  
  65. /* DEFINES
  66.  * ===================================================================
  67.  */
  68. #define FRONT_HEIGHT  14
  69.  
  70.  
  71.  
  72. /* GLOBALS
  73.  * ===================================================================
  74.  */
  75. char InstalledText[8];        /* Text strings for font statistics */
  76. char AvailableText[8];
  77. char TotalText[8];
  78. int  MakeWidthFlag;    /* Make or not width Tables.*/
  79. int  OldCurrentWidth;
  80.  
  81.  
  82.  
  83. /* FUNCTIONS
  84.  * ===================================================================
  85.  */
  86.  
  87.  
  88. /* DoOptions()
  89.  * ===================================================================
  90.  */
  91. void
  92. DoOptions( void )
  93. {
  94.     PrevTree = ad_front;
  95.     Reset_Tree( ad_options );
  96.  
  97.     HideObj( OTITLE3 );
  98.     HideObj( OBASE );
  99.     if( Fonts_Loaded )
  100.     {
  101.       ShowObj( OTITLE3 );
  102.       ShowObj( OBASE );
  103.       sprintf( InstalledText, "%3d", installed_count );
  104.       sprintf( AvailableText, "%3d", available_count );
  105.       sprintf( TotalText, "%3d", font_counter );
  106.       TedText( ONUM1 ) = InstalledText;
  107.       TedText( ONUM2 ) = AvailableText;
  108.       TedText( ONUM3 ) = TotalText;
  109.     }
  110.  
  111.     HideObj( WBACK );
  112.     HideObj( WEXIT );
  113.     HideObj( WCANCEL );
  114.     TedText( OTITLE ) = otitle1;    /* Font Accessory Options */
  115.  
  116.     Objc_draw( tree, ROOT, MAX_DEPTH, NULL ); 
  117. }
  118.  
  119.  
  120.  
  121. /* HandleOptions()
  122.  * ===================================================================
  123.  */
  124. int
  125. HandleOptions( int button, WORD *msg )
  126. {
  127.    int     quit;
  128.  
  129.    quit   = FALSE;
  130.  
  131.    
  132.    /* Handle Double-clicking of the objects */   
  133.    if( ( button != -1 ) && ( button & 0x8000 ) )
  134.       button &= 0x7FFF;
  135.    
  136.    switch( button )
  137.    {
  138.      case OOK:    Deselect( OOK );
  139.           Reset_Tree( ad_front );     
  140.  
  141.           CheckInstallAll( FALSE );
  142.                   mover_setup( installed_list, installed_count,
  143.                          FBASE, FSLIDER, FUP, FDOWN,
  144.                    LINE0, LINE13, LINEBASE, 0, FRONT_HEIGHT );
  145.           HideObj( LINEBASE );
  146.           Objc_draw( tree, ROOT, MAX_DEPTH, NULL ); 
  147.           ShowObj( LINEBASE );
  148.           RedrawBase( tree, LINEBASE );
  149.                break;
  150.  
  151.      case OPATH:  Deselect( OPATH );
  152.           DoPath();
  153.                break;
  154.                
  155.      case OPOINT: Deselect( OPOINT );
  156.           DoPoints( ad_options, 0 );
  157.                break;          
  158.  
  159.      case OCACHE: Deselect( OCACHE );
  160.                DoCache();
  161.                break;
  162.                
  163.      case OWIDTH:  Deselect( OWIDTH );
  164.                 DoWidth();
  165.                 break;
  166.  
  167.      case WEXIT:   Current.Width = (( IsSelected( WON ) ) ? ( TRUE ) : ( FALSE ) );
  168.                 CacheCheck();
  169.                     
  170.      case WCANCEL: Deselect( button );
  171.                 if( button == WEXIT )
  172.                 {
  173.                    if( Current.Width != OldCurrentWidth )
  174.                     SetChangeFlag();
  175.                 }
  176.                 else
  177.                   Current.Width = OldCurrentWidth;
  178.                   
  179.                 HideObj( WBACK );
  180.                 HideObj( WEXIT );
  181.                 HideObj( WCANCEL );
  182.            RedrawObject( tree, WEXIT );
  183.            RedrawObject( tree, WCANCEL );
  184.                 
  185.                 ShowObj( OBACK1 );
  186.                 ShowObj( OOK );
  187. /*                
  188.            Objc_draw( tree, OBACK1, MAX_DEPTH, NULL );
  189.  */
  190.             /* Force a redraw the size of the WBACK */
  191.             RedrawObject( tree, WBACK );           
  192.            RedrawObject( tree, OOK );
  193.  
  194.            TedText( OTITLE ) = otitle1;    /* Width Table Options */
  195.            RedrawObject( tree, OTITLE );
  196.                 break;
  197.  
  198.      case WBUILD:  Make_Width_Table();
  199.                 XDeselect( tree, WBUILD );
  200.                 break;
  201.                                                 
  202.      default:     if( button == -1 )
  203.               {
  204.                 switch( msg[0] )
  205.                 {
  206.                   case WM_REDRAW: 
  207.                                break;
  208.                                    
  209.                   case AC_CLOSE:  quit = TRUE;
  210.                                break;
  211.                                        
  212.                   case WM_CLOSED: quit = TRUE;
  213.                                if( !IsHidden( WBACK ) )
  214.                                {
  215.                        Current.Width = (( IsSelected( WON ) ) ? ( TRUE ) : ( FALSE ) );                  
  216.                                   if( Current.Width != OldCurrentWidth )
  217.                               SetChangeFlag();
  218.                              }      
  219.                                CloseWindow();
  220.                      break;
  221.  
  222.              case CT_KEY:
  223.                           break;
  224.                   default:
  225.                           break;
  226.                 }
  227.               }
  228.               break;
  229.    }
  230.    return( quit );
  231.  
  232.  
  233. }
  234.  
  235.  
  236.  
  237.  
  238. /* DoWidth()
  239.  * ===================================================================
  240.  * DIsplay and prompt to turn width tables on/off or build them.
  241.  */
  242. void
  243. DoWidth( void )
  244. {
  245.    HideObj( OBACK1 );
  246.    HideObj( OOK );
  247.    RedrawObject( tree, OOK );
  248.    
  249.    ShowObj( WBACK );
  250.    ShowObj( WEXIT );
  251.    ShowObj( WCANCEL );
  252.  
  253.    Deselect( WON );
  254.    Deselect( WOFF );
  255.    if( Current.Width )
  256.       Select( WON );
  257.    else
  258.       Select( WOFF );   
  259.  
  260.    OldCurrentWidth = Current.Width;
  261.          
  262.    TedText( OTITLE ) = otitle2;    /* Width Table Options */
  263.    
  264.    Disable( WBUILD );
  265.    NoExit( WBUILD );
  266.    if( SpeedoFlag )
  267.    {
  268.       Enable( WBUILD );
  269.       MakeExit( WBUILD );
  270.    }
  271.          
  272.    RedrawObject( tree, WBACK );           
  273.    
  274.    RedrawObject( tree, WEXIT );
  275.    RedrawObject( tree, WCANCEL );
  276.    RedrawObject( tree, OTITLE );
  277. }
  278.  
  279.